package com.starsea.book.ui.newpage.activity

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import androidx.activity.viewModels
import androidx.core.widget.addTextChangedListener
import com.starsea.book.base.VMBaseActivity
import com.starsea.book.databinding.ActivityMainBinding
import com.starsea.book.databinding.ActivityRealNameBinding
import com.starsea.book.ui.main.MainViewModel
import com.starsea.book.ui.newpage.viewmodel.UserViewModel
import com.starsea.book.utils.viewbindingdelegate.viewBinding

/**
 * @author Lee
 * @createTime 2024-08-25 14 GMT+8
 * @desc :
 */
class RealNameActivity : VMBaseActivity<ActivityRealNameBinding, UserViewModel>() {

    override val binding by viewBinding(ActivityRealNameBinding::inflate)
    override val viewModel by viewModels<UserViewModel>()
    override fun onActivityCreated(savedInstanceState: Bundle?) {

        binding.etName.addTextChangedListener {
            cer()
        }
        binding.etNum.addTextChangedListener {
            cer()
        }

        binding.rtvCommit.setOnClickListener {

        }
    }




    fun cer() {
        binding.rtvCommit.isEnabled =
            !TextUtils.isEmpty(binding.etName.text.toString()) &&
                    !TextUtils.isEmpty(binding.etNum.text.toString()) &&
                    binding.etNum.text.toString().length == 18
    }
}